<?php
use think\facade\Route;

Route::group('login',function (){
    Route::get('login','Login/index');
    Route::post('dologin','Login/doLogin');
})->allowCrossDomain();

Route::group(function (){
    Route::get('/','Home/index');
})->allowCrossDomain()->middleware(\app\admin\middleware\Login::class);

Route::group('power',function (){
    Route::any('adminlist','Admin/adminList');
    Route::get('adminadd','Admin/adminAdd');
    Route::post('adminsave','Admin/adminsave');
    Route::post('admindelete/:id','Admin/adminDelete');
    Route::get('adminedit/:id','Admin/adminEdit');
    Route::post('adminupdate','Admin/adminUpdate');
    Route::get('adminstate/:id','Admin/adminState');
    Route::get('rolelist','Role/roleList');
    Route::get('roleadd','Role/roleAdd');
    Route::post('rolesave','Role/roleSave');
    Route::get('roleedit/:id','Role/roleEdit');
    Route::post('roleupdate','Role/roleUpdate');
    Route::post('roledelete/:id','Role/roleDelete');
    Route::post('rolebatchdelete','Role/roleBatchDelete');
})->allowCrossDomain()->middleware(\app\admin\middleware\Login::class);

Route::group('system',function (){
    Route::get('authlist','Auth/authList');
    Route::get('authadd','Auth/authAdd');
    Route::post('authsave','Auth/authSave');
    Route::post('authdelete/:id','Auth/authDelete');
    Route::get('authedit/:id','Auth/authEdit');
    Route::post('authupdate','Auth/authUpdate');
})->allowCrossDomain()->middleware(\app\admin\middleware\Login::class);

Route::group('goods',function (){
    Route::any('goodsList','Goods/goodsList');
    Route::get('goodsadd','Goods/goodsAdd');
    Route::post('findcate','Common/findCate');
    Route::post('findbrand','Common/findBrand');
    Route::post('getspecattr','Common/getSpecAttr');
})->allowCrossDomain()->middleware(\app\admin\middleware\Login::class);